--[[
通用Action节点
--]]
BTActionUniversal = BTAction:New()

local this = BTActionUniversal
this.name = "Action Task"

function this:New(enterFunc, executeFunc, exitFunc)
	local o = {}
	setmetatable(o, self)
	self.__index = self
	o.enterFunc = enterFunc
	o.executeFunc = executeFunc
	o.exitFunc = exitFunc
	return o
end

function this:Enter()
	if (self.enterFunc) then
		self.enterFunc()
	end
end

function this:Execute()
	if (self.executeFunc) then
		self.executionStatus = BTTaskStatus.Success
		return self.executeFunc()
	else
		self.executionStatus = BTTaskStatus.Failure
		return BTTaskStatus.Failure
	end
end

function this:Exit()
	if (self.exitFunc) then
		self.exitFunc()
	end
end